/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Global;

import MainProgram.UI.FileOpen;
import java.awt.Component;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileFilter;

/**
 *
 * @author Stephen
 */
public class FileFinder
{
    public static File FindChangelogFile()
    {
        File runtimeFolder = FolderFinder.getProgramRuntimeFolder_Advanced();

        File folder = new File(runtimeFolder.getPath());
        for (int i = 0; i < 100; i++)
        {
            if (new File(folder, "Change Log.txt").exists())
                return new File(folder, "Change Log.txt");
            if(folder.getParentFile() == null)
                break; //Give up
            folder = folder.getParentFile();
        }
        
        //It should be in the folder about the runtime folder, so return that if search failed
        return folder.getParentFile();
    }
}
